Add support for json type in MongoDB#25089
Conversation
|
|
e92c5c5 to
afd29df
Compare
34d06b9 to
19b069f
Compare
bfc9e97 to
c425186
Compare
| throws IOException | ||
| { | ||
| return Slices.wrappedBuffer(SORTED_MAPPER.writeValueAsBytes(value)); | ||
| } |
| if (isJsonType(type)) { | ||
| String json = type.getSlice(block, position).toStringUtf8(); | ||
| try { | ||
| return Document.parse(json); |
|
Please add documentation entry as well in https://prestodb.io/docs/current/connector/mongodb.html |
Cherry-pick of trinodb/trino#8584 Co-authored-by: Yuya Ebihara <ebyhry@gmail.com> Co-authored-by: v-jizhang <z_jinlin@yahoo.com>
c425186 to
bdae204
Compare
@agrawalreetika I added a short section in the MongoDB docs explaining how json values are parsed. Not totally sure if that’s the right way—can you check it when you get a chance? @steveburnett is this the correct place for it? |
LGTM! @agrawalreetika, does this doc satisfy your request? |
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Pull branch, local doc build, looks good. Thanks!
agrawalreetika
left a comment
There was a problem hiding this comment.
Thanks for the change. LGTM
Cherry-pick of trinodb/trino#8584
Description
This PR adds support for the json type in the MongoDB connector.
It’s based on #17336, which no longer being worked on.
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.